//============================================================================================
/**
 * @file	zkn2_ui.c
 * @brief	金銀図鑑画面 インターフェース関連
 * @author	Hiroyuki Nakamura
 * @date	08.08.26
 */
//============================================================================================
#include "common.h"

#include "gflib/touchpanel.h"

#include "zkn2_main.h"
#include "zkn2_list.h"
#include "zkn2_obj.h"
#include "zkn2_ui.h"


//============================================================================================
//	定数定義
//============================================================================================
#define	LIST_BLOCK_SX	( 40 )		// リスト画面のアイコン表示エリアの１ブロックのＸサイズ
#define	LIST_BLOCK_SY	( 40 )		// リスト画面のアイコン表示エリアの１ブロックのＹサイズ
#define	LIST_AREA_LX	( 27 )		// リスト画面のアイコン表示エリアの左上Ｘ座標
#define	LIST_AREA_LY	( 4 )		// リスト画面のアイコン表示エリアの左上Ｙ座標
// リスト画面のアイコン表示エリアの右下Ｘ座標
#define	LIST_AREA_RX	( LIST_AREA_LX + LIST_BLOCK_SX * ZKN2_POKEICON_PUT_H_MAX - 1 )
// リスト画面のアイコン表示エリアの右下Ｙ座標
#define	LIST_AREA_RY	( LIST_AREA_LY + LIST_BLOCK_SY * ZKN2_POKEICON_SEL_V_MAX - 1 )

#define	HITTBL_POS_TOP_COVER	( 1 )	// ヒットテーブル位置：トップページのカバー
#define	HITTBL_POS_LIST_COVER	( 1 )	// ヒットテーブル位置：リストページのカバー

// 検索画面名前入力ページのデータ
#define	SEARCH_NAME_PX		( 8 )
#define	SEARCH_NAME_PY		( 40 )
#define	SEARCH_NAME_SX		( 16 )
#define	SEARCH_NAME_SY		( 16 )
#define	SEARCH_NAME_SPACE_X	( 24 )
#define	SEARCH_NAME_SPACE_Y	( 24 )
#define	SEARCH_NAME_MY		( 5 )
#define	SEARCH_NAME_LX(a)	( SEARCH_NAME_PX + a / SEARCH_NAME_MY * SEARCH_NAME_SPACE_X )
#define	SEARCH_NAME_RX(a)	( SEARCH_NAME_LX(a) + SEARCH_NAME_SX - 1 )
#define	SEARCH_NAME_UY(a)	( SEARCH_NAME_PY + a % SEARCH_NAME_MY * SEARCH_NAME_SPACE_Y )
#define	SEARCH_NAME_DY(a)	( SEARCH_NAME_UY(a) + SEARCH_NAME_SY - 1 )
#define	SEARCH_NAME_CUR_X(a)	( SEARCH_NAME_LX(a) + SEARCH_NAME_SX / 2 )
#define	SEARCH_NAME_CUR_Y(a)	( SEARCH_NAME_UY(a) + SEARCH_NAME_SY / 2 )

// 検索画面サイズ入力ページのデータ
#define	SEARCH_MAX_AREA_LX	( 26 )
#define	SEARCH_MAX_AREA_RX	( 229 )
#define	SEARCH_MAX_AREA_UY	( 46 )
#define	SEARCH_MAX_AREA_DY	( 73 )
#define	SEARCH_MIN_AREA_LX	( 26 )
#define	SEARCH_MIN_AREA_RX	( 229 )
#define	SEARCH_MIN_AREA_UY	( 118 )
#define	SEARCH_MIN_AREA_DY	( 145 )


//============================================================================================
//	プロトタイプ宣言
//============================================================================================
static void CursorMoveCallBack_Dummy( void * work, int now_pos, int old_pos );

static void SearchCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchMainCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchMainCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );

static void SearchRowCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchRowCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchRowCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );

static void SearchNameCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchNameCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchNameCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );

static void SearchTypeCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchTypeCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchTypeCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );

static void SearchHeightCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchHeightCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchHeightCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );

static void SearchWeightCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchWeightCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchWeightCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );

static void SearchAreaCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchAreaCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchAreaCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );

static void SearchFormCursorObjMove( ZKN2_WORK * wk, int pos );
static void SearchFormCursorMoveCallBack_Move( void * work, int now_pos, int old_pos );
static void SearchFormCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos );


//============================================================================================
//	グローバル変数
//============================================================================================

// タッチ座標テーブル：トップページ
static const RECT_HIT_TBL TopPageHitTbl[] =
{
//	{ 120, 135,  96, 160 },		// スイッチ
	{ 112, 143,  96, 160 },		// スイッチ
	{   0, 151,   0, 255 },		// カバー
	{ 152, 187,   0,  63 },		// さがす
	{ 152, 187,  64, 191 },		// ひらく
	{ 152, 187, 192, 255 },		// おわる
	{ RECT_HIT_END, 0, 0, 0 }
};
// タッチＩＤテーブル：トップページ
static const u32 TopPageRetTbl[] = {
	ZKN2UI_TOP_SWITCH,			// 図鑑モード切り替え（タッチ）
	ZKN2UI_TOP_COVER,			// カバーを開く動作へ（タッチ）
	ZKN2UI_TOP_SUARCH,			// 探す
	ZKN2UI_TOP_OPEN,			// 開く
	ZKN2UI_TOP_CANCEL,			// 終わる
};

// タッチ座標テーブル：リストページ
static const RECT_HIT_TBL ListPageHitTbl[] =
{
	{ LIST_AREA_LY, LIST_AREA_RY, LIST_AREA_LX, LIST_AREA_RX },		// リストエリア
	{   0, 124,   0,  23 },		// カバーハンドル
	{   5,  20, 231, 252 },		// 上矢印
	{ 131, 146, 231, 252 },		// 下矢印
	{  21, 130, 231, 252 },		// レール
	{ 128, 143,  48,  79 },		// 左矢印
	{ 128, 143, 168, 199 },		// 右矢印
	{ 152, 187,   0,  63 },		// さがす
	{ 152, 187,  64, 127 },		// なきごえ
	{ 152, 187, 128, 191 },		// くわしく
	{ 152, 187, 192, 255 },		// おわる
	{ RECT_HIT_END, 0, 0, 0 }
};
// タッチＩＤテーブル：リストページ
static const u32 ListPageRetTbl[] = {
	ZKN2UI_LIST_MOVE,			// ポケモン切り替え
	ZKN2UI_LIST_COVER,			// カバーを閉じる動作へ（タッチ）
	ZKN2UI_LIST_ARROW_U,		// ポケモンスクロール（上）
	ZKN2UI_LIST_ARROW_D,		// ポケモンスクロール（下）
	ZKN2UI_LIST_RAIL,			// ポケモンスクロール（フリー）
	ZKN2UI_LIST_ARROW_L,		// 表示言語切り替え（左）
	ZKN2UI_LIST_ARROW_R,		// 表示言語切り替え（右）
	ZKN2UI_LIST_SUARCH,			// 探す
	ZKN2UI_LIST_VOICE,			// 鳴き声
	ZKN2UI_LIST_INFO,			// 詳しく
	ZKN2UI_LIST_CANCEL,			// 終わる
};

// 検索画面・メイン
static const RECT_HIT_TBL SearchMainHitTbl[] =
{
	{   8,  23, 128, 215 },		// 00: 並び順
	{  32,  47,  56, 127 },		// 01: 名前
	{  56,  71,  56, 175 },		// 02: タイプ
	{  80,  95,  56, 183 },		// 03: 高さ
	{ 104, 119,  56, 239 },		// 04: 重さ
	{ 128, 143,  56, 111 },		// 05: 地域
	{  56,  87, 208, 239 },		// 06: 形

	{ 164, 187,   4,  75 },		// 07: リセット
	{ 164, 187,  92, 163 },		// 08: スタート
	{ 164, 187, 180, 251 },		// 09: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchMainKeyTbl[] =
{
	{ 172,  16, 0, 0,	0, 1, 0, 0 },		// 00: 並び順
	{  92,  40, 0, 0,	0, 2, 1, 6 },		// 01: 名前
	{ 116,  64, 0, 0,	1, 3, 2, 6 },		// 02: タイプ
	{ 112,  88, 0, 0,	2, 4, 3, 6 },		// 03: 高さ
	{ 136, 112, 0, 0,	3, 5, 4, 4 },		// 04: 重さ
	{  84, 136, 0, 0,	4, CURSORMOVE_RETBIT|8, 5, 5 },		// 05: 地域
	{ 224,  72, 0, 0,	0, 4, CURSORMOVE_RETBIT|1, 6 },		// 06: 形

	{  40, 176, 0, 0,	5, 7, 7, 8 },		// 07: リセット
	{ 128, 176, 0, 0,	5, 8, 7, 9 },		// 08: スタート
	{ 216, 176, 0, 0,	5, 9, 8, 9 },		// 09: やめる
};
static const CURSORMOVE_CALLBACK SearchMainCallBack = {
	CursorMoveCallBack_Dummy,			// on,
	CursorMoveCallBack_Dummy,			// off
	SearchMainCursorMoveCallBack_Move,	// move
	SearchMainCursorMoveCallBack_Toucn,	// touch
};
static const u8 SearchCursorAnmTbl[] = {
	ZKN2OBJ_M_ANM_CUR_X_11x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_15x2,
	ZKN2OBJ_M_ANM_CUR_X_14x2,
	ZKN2OBJ_M_ANM_CUR_X_20x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_4x4,

	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
};

// 検索画面・並び順
static const RECT_HIT_TBL SearchRowHitTbl[] =
{
	{  48,  63,  24, 111 },		// 00: ばんごう
	{  48,  63, 144, 231 },		// 01: ごじゅうおん
	{  80,  95,  24, 111 },		// 02: おもい
	{  80,  95, 144, 231 },		// 03: かるい
	{ 112, 127,  24, 111 },		// 04: たかい
	{ 112, 127, 144, 231 },		// 05: ひくい

	{ 164, 187,   4,  75 },		// 06: けってい
	{ 164, 187, 180, 251 },		// 07: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchRowKeyTbl[] =
{
	{  68,  56, 0, 0,	6, 2, 1, 1 },		// 00: ばんごう
	{ 188,  56, 0, 0,	7, 3, 0, 0 },		// 01: ごじゅうおん
	{  68,  88, 0, 0,	0, 4, 3, 3 },		// 02: おもい
	{ 188,  88, 0, 0,	1, 5, 2, 2 },		// 03: かるい
	{  68, 120, 0, 0,	2, 6, 5, 5 },		// 04: たかい
	{ 188, 120, 0, 0,	3, 7, 4, 4 },		// 05: ひくい

	{  40, 176, 0, 0,	4, 0, 7, 7 },		// 06: けってい
	{ 216, 176, 0, 0,	5, 1, 6, 6 },		// 07: やめる
};
static const CURSORMOVE_CALLBACK SearchRowCallBack = {
	CursorMoveCallBack_Dummy,			// on,
	CursorMoveCallBack_Dummy,			// off
	SearchRowCursorMoveCallBack_Move,	// move
	SearchRowCursorMoveCallBack_Toucn,	// touch
};
static const u8 SearchRowCursorAnmTbl[] = {
	ZKN2OBJ_M_ANM_CUR_X_11x2,
	ZKN2OBJ_M_ANM_CUR_X_11x2,
	ZKN2OBJ_M_ANM_CUR_X_11x2,
	ZKN2OBJ_M_ANM_CUR_X_11x2,
	ZKN2OBJ_M_ANM_CUR_X_11x2,
	ZKN2OBJ_M_ANM_CUR_X_11x2,

	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
};

// 検索画面・なまえ
static const RECT_HIT_TBL SearchNameHitTbl[] =
{
	{ SEARCH_NAME_UY(0), SEARCH_NAME_DY(0), SEARCH_NAME_LX(0), SEARCH_NAME_RX(0) },	// ア
	{ SEARCH_NAME_UY(1), SEARCH_NAME_DY(1), SEARCH_NAME_LX(1), SEARCH_NAME_RX(1) },
	{ SEARCH_NAME_UY(2), SEARCH_NAME_DY(2), SEARCH_NAME_LX(2), SEARCH_NAME_RX(2) },
	{ SEARCH_NAME_UY(3), SEARCH_NAME_DY(3), SEARCH_NAME_LX(3), SEARCH_NAME_RX(3) },
	{ SEARCH_NAME_UY(4), SEARCH_NAME_DY(4), SEARCH_NAME_LX(4), SEARCH_NAME_RX(4) },

	{ SEARCH_NAME_UY(5), SEARCH_NAME_DY(5), SEARCH_NAME_LX(5), SEARCH_NAME_RX(5) },	// カ
	{ SEARCH_NAME_UY(6), SEARCH_NAME_DY(6), SEARCH_NAME_LX(6), SEARCH_NAME_RX(6) },
	{ SEARCH_NAME_UY(7), SEARCH_NAME_DY(7), SEARCH_NAME_LX(7), SEARCH_NAME_RX(7) },
	{ SEARCH_NAME_UY(8), SEARCH_NAME_DY(8), SEARCH_NAME_LX(8), SEARCH_NAME_RX(8) },
	{ SEARCH_NAME_UY(9), SEARCH_NAME_DY(9), SEARCH_NAME_LX(9), SEARCH_NAME_RX(9) },

	{ SEARCH_NAME_UY(10), SEARCH_NAME_DY(10), SEARCH_NAME_LX(10), SEARCH_NAME_RX(10) },	// サ
	{ SEARCH_NAME_UY(11), SEARCH_NAME_DY(11), SEARCH_NAME_LX(11), SEARCH_NAME_RX(11) },
	{ SEARCH_NAME_UY(12), SEARCH_NAME_DY(12), SEARCH_NAME_LX(12), SEARCH_NAME_RX(12) },
	{ SEARCH_NAME_UY(13), SEARCH_NAME_DY(13), SEARCH_NAME_LX(13), SEARCH_NAME_RX(13) },
	{ SEARCH_NAME_UY(14), SEARCH_NAME_DY(14), SEARCH_NAME_LX(14), SEARCH_NAME_RX(14) },

	{ SEARCH_NAME_UY(15), SEARCH_NAME_DY(15), SEARCH_NAME_LX(15), SEARCH_NAME_RX(15) },	// タ
	{ SEARCH_NAME_UY(16), SEARCH_NAME_DY(16), SEARCH_NAME_LX(16), SEARCH_NAME_RX(16) },
	{ SEARCH_NAME_UY(17), SEARCH_NAME_DY(17), SEARCH_NAME_LX(17), SEARCH_NAME_RX(17) },
	{ SEARCH_NAME_UY(18), SEARCH_NAME_DY(18), SEARCH_NAME_LX(18), SEARCH_NAME_RX(18) },
	{ SEARCH_NAME_UY(19), SEARCH_NAME_DY(19), SEARCH_NAME_LX(19), SEARCH_NAME_RX(19) },

	{ SEARCH_NAME_UY(20), SEARCH_NAME_DY(20), SEARCH_NAME_LX(20), SEARCH_NAME_RX(20) },	// ナ
	{ SEARCH_NAME_UY(21), SEARCH_NAME_DY(21), SEARCH_NAME_LX(21), SEARCH_NAME_RX(21) },
	{ SEARCH_NAME_UY(22), SEARCH_NAME_DY(22), SEARCH_NAME_LX(22), SEARCH_NAME_RX(22) },
	{ SEARCH_NAME_UY(23), SEARCH_NAME_DY(23), SEARCH_NAME_LX(23), SEARCH_NAME_RX(23) },
	{ SEARCH_NAME_UY(24), SEARCH_NAME_DY(24), SEARCH_NAME_LX(24), SEARCH_NAME_RX(24) },

	{ SEARCH_NAME_UY(25), SEARCH_NAME_DY(25), SEARCH_NAME_LX(25), SEARCH_NAME_RX(25) },	// ハ
	{ SEARCH_NAME_UY(26), SEARCH_NAME_DY(26), SEARCH_NAME_LX(26), SEARCH_NAME_RX(26) },
	{ SEARCH_NAME_UY(27), SEARCH_NAME_DY(27), SEARCH_NAME_LX(27), SEARCH_NAME_RX(27) },
	{ SEARCH_NAME_UY(28), SEARCH_NAME_DY(28), SEARCH_NAME_LX(28), SEARCH_NAME_RX(28) },
	{ SEARCH_NAME_UY(29), SEARCH_NAME_DY(29), SEARCH_NAME_LX(29), SEARCH_NAME_RX(29) },

	{ SEARCH_NAME_UY(30), SEARCH_NAME_DY(30), SEARCH_NAME_LX(30), SEARCH_NAME_RX(30) },	// マ
	{ SEARCH_NAME_UY(31), SEARCH_NAME_DY(31), SEARCH_NAME_LX(31), SEARCH_NAME_RX(31) },
	{ SEARCH_NAME_UY(32), SEARCH_NAME_DY(32), SEARCH_NAME_LX(32), SEARCH_NAME_RX(32) },
	{ SEARCH_NAME_UY(33), SEARCH_NAME_DY(33), SEARCH_NAME_LX(33), SEARCH_NAME_RX(33) },
	{ SEARCH_NAME_UY(34), SEARCH_NAME_DY(34), SEARCH_NAME_LX(34), SEARCH_NAME_RX(34) },

	{ SEARCH_NAME_UY(35), SEARCH_NAME_DY(35), SEARCH_NAME_LX(35), SEARCH_NAME_RX(35) },	// 35: ヤ
	{ SEARCH_NAME_UY(37), SEARCH_NAME_DY(37), SEARCH_NAME_LX(37), SEARCH_NAME_RX(37) },	// 36: ユ
	{ SEARCH_NAME_UY(39), SEARCH_NAME_DY(39), SEARCH_NAME_LX(39), SEARCH_NAME_RX(39) },	// 37: ヨ

	{ SEARCH_NAME_UY(40), SEARCH_NAME_DY(40), SEARCH_NAME_LX(40), SEARCH_NAME_RX(40) },	// 38: ラ
	{ SEARCH_NAME_UY(41), SEARCH_NAME_DY(41), SEARCH_NAME_LX(41), SEARCH_NAME_RX(41) },
	{ SEARCH_NAME_UY(42), SEARCH_NAME_DY(42), SEARCH_NAME_LX(42), SEARCH_NAME_RX(42) },
	{ SEARCH_NAME_UY(43), SEARCH_NAME_DY(43), SEARCH_NAME_LX(43), SEARCH_NAME_RX(43) },
	{ SEARCH_NAME_UY(44), SEARCH_NAME_DY(44), SEARCH_NAME_LX(44), SEARCH_NAME_RX(44) },

	{ SEARCH_NAME_UY(45), SEARCH_NAME_DY(45), SEARCH_NAME_LX(45), SEARCH_NAME_RX(45) },	// 43: ワ
	{ SEARCH_NAME_UY(46), SEARCH_NAME_DY(46), SEARCH_NAME_LX(46), SEARCH_NAME_RX(46) },	// 44: ー

	{ 164, 187,   4,  75 },		// 45: けってい
	{ 164, 187, 180, 251 },		// 46: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchNameKeyTbl[] =
{
	{ SEARCH_NAME_CUR_X(0),SEARCH_NAME_CUR_Y(0),0,0,	45,  1, 43, 5 },	// ア
	{ SEARCH_NAME_CUR_X(1),SEARCH_NAME_CUR_Y(1),0,0,	 0,  2, 44, 6 },
	{ SEARCH_NAME_CUR_X(2),SEARCH_NAME_CUR_Y(2),0,0,	 1,  3, 40, 7 },
	{ SEARCH_NAME_CUR_X(3),SEARCH_NAME_CUR_Y(3),0,0,	 2,  4, 41, 8 },
	{ SEARCH_NAME_CUR_X(4),SEARCH_NAME_CUR_Y(4),0,0,	 3, 45, 42, 9 },

	{ SEARCH_NAME_CUR_X(5),SEARCH_NAME_CUR_Y(5),0,0,	45,  6, 0, 10 },	// カ
	{ SEARCH_NAME_CUR_X(6),SEARCH_NAME_CUR_Y(6),0,0,	 5,  7, 1, 11 },
	{ SEARCH_NAME_CUR_X(7),SEARCH_NAME_CUR_Y(7),0,0,	 6,  8, 2, 12 },
	{ SEARCH_NAME_CUR_X(8),SEARCH_NAME_CUR_Y(8),0,0,	 7,  9, 3, 13 },
	{ SEARCH_NAME_CUR_X(9),SEARCH_NAME_CUR_Y(9),0,0,	 8, 45, 4, 14 },

	{ SEARCH_NAME_CUR_X(10),SEARCH_NAME_CUR_Y(10),0,0,	45, 11, 5, 15 },	// サ
	{ SEARCH_NAME_CUR_X(11),SEARCH_NAME_CUR_Y(11),0,0,	10, 12, 6, 16 },
	{ SEARCH_NAME_CUR_X(12),SEARCH_NAME_CUR_Y(12),0,0,	11, 13, 7, 17 },
	{ SEARCH_NAME_CUR_X(13),SEARCH_NAME_CUR_Y(13),0,0,	12, 14, 8, 18 },
	{ SEARCH_NAME_CUR_X(14),SEARCH_NAME_CUR_Y(14),0,0,	13, 45, 9, 19 },

	{ SEARCH_NAME_CUR_X(15),SEARCH_NAME_CUR_Y(15),0,0,	45, 16, 10, 20 },	// タ
	{ SEARCH_NAME_CUR_X(16),SEARCH_NAME_CUR_Y(16),0,0,	15, 17, 11, 21 },
	{ SEARCH_NAME_CUR_X(17),SEARCH_NAME_CUR_Y(17),0,0,	16, 18, 12, 22 },
	{ SEARCH_NAME_CUR_X(18),SEARCH_NAME_CUR_Y(18),0,0,	17, 19, 13, 23 },
	{ SEARCH_NAME_CUR_X(19),SEARCH_NAME_CUR_Y(19),0,0,	18, 45, 14, 24 },

	{ SEARCH_NAME_CUR_X(20),SEARCH_NAME_CUR_Y(20),0,0,	45, 21, 15, 25 },	// ナ
	{ SEARCH_NAME_CUR_X(21),SEARCH_NAME_CUR_Y(21),0,0,	20, 22, 16, 26 },
	{ SEARCH_NAME_CUR_X(22),SEARCH_NAME_CUR_Y(22),0,0,	21, 23, 17, 27 },
	{ SEARCH_NAME_CUR_X(23),SEARCH_NAME_CUR_Y(23),0,0,	22, 24, 18, 28 },
	{ SEARCH_NAME_CUR_X(24),SEARCH_NAME_CUR_Y(24),0,0,	23, 45, 19, 29 },

	{ SEARCH_NAME_CUR_X(25),SEARCH_NAME_CUR_Y(25),0,0,	46, 26, 20, 30 },	// ハ
	{ SEARCH_NAME_CUR_X(26),SEARCH_NAME_CUR_Y(26),0,0,	25, 27, 21, 31 },
	{ SEARCH_NAME_CUR_X(27),SEARCH_NAME_CUR_Y(27),0,0,	26, 28, 22, 32 },
	{ SEARCH_NAME_CUR_X(28),SEARCH_NAME_CUR_Y(28),0,0,	27, 29, 23, 33 },
	{ SEARCH_NAME_CUR_X(29),SEARCH_NAME_CUR_Y(29),0,0,	28, 46, 24, 34 },

	{ SEARCH_NAME_CUR_X(30),SEARCH_NAME_CUR_Y(30),0,0,	46, 31, 25, 35 },	// マ
	{ SEARCH_NAME_CUR_X(31),SEARCH_NAME_CUR_Y(31),0,0,	30, 32, 26, 39 },
	{ SEARCH_NAME_CUR_X(32),SEARCH_NAME_CUR_Y(32),0,0,	31, 33, 27, 36 },
	{ SEARCH_NAME_CUR_X(33),SEARCH_NAME_CUR_Y(33),0,0,	32, 34, 28, 41 },
	{ SEARCH_NAME_CUR_X(34),SEARCH_NAME_CUR_Y(34),0,0,	33, 46, 29, 37 },

	{ SEARCH_NAME_CUR_X(35),SEARCH_NAME_CUR_Y(35),0,0,	46, 36, 30, 38 },	// ヤ
	{ SEARCH_NAME_CUR_X(37),SEARCH_NAME_CUR_Y(37),0,0,	35, 37, 32, 40 },
	{ SEARCH_NAME_CUR_X(39),SEARCH_NAME_CUR_Y(39),0,0,	36, 46, 34, 42 },

	{ SEARCH_NAME_CUR_X(40),SEARCH_NAME_CUR_Y(40),0,0,	46, 39, 35, 43 },	// ラ
	{ SEARCH_NAME_CUR_X(41),SEARCH_NAME_CUR_Y(41),0,0,	38, 40, 31, 44 },
	{ SEARCH_NAME_CUR_X(42),SEARCH_NAME_CUR_Y(42),0,0,	39, 41, 36,  2 },
	{ SEARCH_NAME_CUR_X(43),SEARCH_NAME_CUR_Y(43),0,0,	40, 42, 33,  3 },
	{ SEARCH_NAME_CUR_X(44),SEARCH_NAME_CUR_Y(44),0,0,	41, 46, 37,  4 },

	{ SEARCH_NAME_CUR_X(45),SEARCH_NAME_CUR_Y(45),0,0,	46, 44, 38,  0 },	// ワ
	{ SEARCH_NAME_CUR_X(46),SEARCH_NAME_CUR_Y(46),0,0,	43, 46, 39,  1 },

	{  40, 176, 0, 0,	 4,  0, 46, 46 },		// 45: けってい
	{ 216, 176, 0, 0,	44, 43, 45, 45 },		// 46: やめる
};
static const CURSORMOVE_CALLBACK SearchNameCallBack = {
	CursorMoveCallBack_Dummy,			// on,
	CursorMoveCallBack_Dummy,			// off
	SearchNameCursorMoveCallBack_Move,	// move
	SearchNameCursorMoveCallBack_Toucn,	// touch
};

// 検索画面・タイプ
static const RECT_HIT_TBL SearchTypeHitTbl[] =
{
	{  40,  55,   4,  59 },		// 00: あく
	{  40,  55,  68, 123 },		// 01: いわ
	{  40,  55, 132, 187 },		// 02: エスパー
	{  40,  55, 196, 251 },		// 03: かくとう

	{  64,  79,   4,  59 },		// 04: くさ
	{  64,  79,  68, 123 },		// 05: こおり
	{  64,  79, 132, 187 },		// 06: ゴースト
	{  64,  79, 196, 251 },		// 07: じめん

	{  88, 104,   4,  59 },		// 08: でんき
	{  88, 104,  68, 123 },		// 09: どく
	{  88, 104, 132, 187 },		// 10: ドラゴン
	{  88, 104, 196, 251 },		// 11: ノーマル

	{ 112, 127,   4,  59 },		// 12: はがね
	{ 112, 127,  68, 123 },		// 13: ひこう
	{ 112, 127, 132, 187 },		// 14: ほのお
	{ 112, 127, 196, 251 },		// 15: みず

	{ 136, 151,   4,  59 },		// 16: むし
	{ 136, 151,  68, 123 },		// 17: −−−−

	{ 164, 187,   4,  75 },		// 18: けってい
	{ 164, 187, 180, 251 },		// 19: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchTypeKeyTbl[] =
{
	{  32,  48, 0, 0,	18, 4, 3, 1 },		// 00: あく
	{  96,  48, 0, 0,	18, 5, 0, 2 },		// 01: いわ
	{ 160,  48, 0, 0,	19, 6, 1, 3 },		// 02: エスパー
	{ 224,  48, 0, 0,	19, 7, 2, 0 },		// 03: かくとう

	{  32,  72, 0, 0,	0,  8, 7, 5 },		// 04: くさ
	{  96,  72, 0, 0,	1,  9, 4, 6 },		// 05: こおり
	{ 160,  72, 0, 0,	2, 10, 5, 7 },		// 06: ゴースト
	{ 224,  72, 0, 0,	3, 11, 6, 4 },		// 07: じめん

	{  32,  96, 0, 0,	4, 12, 11,  9 },	// 08: でんき
	{  96,  96, 0, 0,	5, 13,  8, 10 },	// 09: どく
	{ 160,  96, 0, 0,	6, 14,  9, 11 },	// 10: ドラゴン
	{ 224,  96, 0, 0,	7, 15, 10,  8 },	// 11: ノーマル

	{  32, 120, 0, 0,	 8, 16, 15, 13 },	// 12: はがね
	{  96, 120, 0, 0,	 9, 17, 12, 14 },	// 13: ひこう
	{ 160, 120, 0, 0,	10, 19, 13, 15 },	// 14: ほのお
	{ 224, 120, 0, 0,	11, 19, 14, 12 },	// 15: みず

	{  32, 144, 0, 0,	12, 18, 17, 17 },	// 16: むし
	{  96, 144, 0, 0,	13, 18, 16, 16 },	// 17: −−−−

	{  40, 176, 0, 0,	16, 0, 19, 19 },	// 18: けってい
	{ 216, 176, 0, 0,	15, 3, 18, 18 },	// 19: やめる
};
static const CURSORMOVE_CALLBACK SearchTypeCallBack = {
	CursorMoveCallBack_Dummy,			// on,
	CursorMoveCallBack_Dummy,			// off
	SearchTypeCursorMoveCallBack_Move,	// move
	SearchTypeCursorMoveCallBack_Toucn,	// touch
};
static const u8 SearchTypeCursorAnmTbl[] = {
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,

	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
};

// 検索画面・たかさ
static const RECT_HIT_TBL SearchHeightHitTbl[] =
{
	{ SEARCH_MAX_AREA_UY, SEARCH_MAX_AREA_DY, SEARCH_MAX_AREA_LX, SEARCH_MAX_AREA_RX },	// 00: MAX
	{ SEARCH_MIN_AREA_UY, SEARCH_MIN_AREA_DY, SEARCH_MIN_AREA_LX, SEARCH_MIN_AREA_RX },	// 01: MIX
	{ 164, 187,   4,  75 },		// 02: けってい
	{ 164, 187, 180, 251 },		// 03: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchHeightKeyTbl[] =
{
	{  52,  60, 0, 0,	2, 1, 0, 0 },	// 00: MAX
	{ 204, 132, 0, 0,	0, CURSORMOVE_RETBIT|2, 1, 1 },	// 01: MIN
	{  40, 176, 0, 0,	1, 0, 3, 3 },	// 02: けってい
	{ 216, 176, 0, 0,	1, 0, 2, 2 },	// 03: やめる
};
static const CURSORMOVE_CALLBACK SearchHeightCallBack = {
	CursorMoveCallBack_Dummy,				// on,
	CursorMoveCallBack_Dummy,				// off
	SearchHeightCursorMoveCallBack_Move,	// move
	SearchHeightCursorMoveCallBack_Toucn,	// touch
};
static const u8 SearchHeightCursorAnmTbl[] = {
	ZKN2OBJ_M_ANM_CUR_X_6x3,
	ZKN2OBJ_M_ANM_CUR_X_6x3,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
};

// 検索画面・おもさ
static const RECT_HIT_TBL SearchWeightHitTbl[] =
{
	{  46,  73,  26, 229 },		// 00: MAX
	{ 118, 145,  26, 229 },		// 01: MIN
	{ 164, 187,   4,  75 },		// 02: けってい
	{ 164, 187, 180, 251 },		// 03: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchWeightKeyTbl[] =
{
	{  52,  60, 0, 0,	2, 1, 0, 0 },	// 00: MAX
	{ 204, 132, 0, 0,	0, CURSORMOVE_RETBIT|2, 1, 1 },	// 01: MIN
	{  40, 176, 0, 0,	1, 0, 3, 3 },	// 02: けってい
	{ 216, 176, 0, 0,	1, 0, 2, 2 },	// 03: やめる
};
static const CURSORMOVE_CALLBACK SearchWeightCallBack = {
	CursorMoveCallBack_Dummy,				// on,
	CursorMoveCallBack_Dummy,				// off
	SearchWeightCursorMoveCallBack_Move,	// move
	SearchWeightCursorMoveCallBack_Toucn,	// touch
};
static const u8 SearchWeightCursorAnmTbl[] = {
	ZKN2OBJ_M_ANM_CUR_X_6x3,
	ZKN2OBJ_M_ANM_CUR_X_6x3,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
};

// 検索画面・ちいき
static const RECT_HIT_TBL SearchAreaHitTbl[] =
{
	{  64,  79,  48, 103 },		// 00: ジョウト
	{  64,  79, 152, 207 },		// 01: カントー
	{ 120, 135,  48, 103 },		// 02: ふめい
	{ 120, 135, 152, 207 },		// 03: −−−−

	{ 164, 187,   4,  75 },		// 04: けってい
	{ 164, 187, 180, 251 },		// 05: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchAreaKeyTbl[] =
{
	{  76,  72, 0, 0,	4, 2, 1, 1 },		// 00: ジョウト
	{ 180,  72, 0, 0,	5, 3, 0, 0 },		// 01: カントー
	{  76, 128, 0, 0,	0, 4, 3, 3 },		// 02: ふめい
	{ 180, 128, 0, 0,	1, 5, 2, 2 },		// 03: −−−−

	{  40, 176, 0, 0,	2, 0, 5, 5 },		// 04: けってい
	{ 216, 176, 0, 0,	3, 1, 4, 4 },		// 05: やめる
};
static const CURSORMOVE_CALLBACK SearchAreaCallBack = {
	CursorMoveCallBack_Dummy,			// on,
	CursorMoveCallBack_Dummy,			// off
	SearchAreaCursorMoveCallBack_Move,	// move
	SearchAreaCursorMoveCallBack_Toucn,	// touch
};
static const u8 SearchAreaCursorAnmTbl[] = {
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,
	ZKN2OBJ_M_ANM_CUR_X_7x2,

	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
};

// 検索画面・かたち
static const RECT_HIT_TBL SearchFormHitTbl[] =
{
	{  40,  71,  16,  47 },		// 00:
	{  40,  71,  64,  95 },		// 01:
	{  40,  71, 112, 143 },		// 02:
	{  40,  71, 160, 191 },		// 03:
	{  40,  71, 208, 239 },		// 04:

	{  80, 111,  16,  47 },		// 05:
	{  80, 111,  64,  95 },		// 06:
	{  80, 111, 112, 143 },		// 07:
	{  80, 111, 160, 191 },		// 08:
	{  80, 111, 208, 239 },		// 09:

	{ 120, 151,  16,  47 },		// 10:
	{ 120, 151,  64,  95 },		// 11:
	{ 120, 151, 112, 143 },		// 12:
	{ 120, 151, 160, 191 },		// 13:
	{ 120, 151, 208, 239 },		// 14:

	{ 164, 187,   4,  75 },		// 15: けってい
	{ 164, 187, 180, 251 },		// 16: やめる

	{ RECT_HIT_END, 0, 0, 0 }
};
static const POINTER_WORK SearchFormKeyTbl[] =
{
	{  32,  56, 0, 0,	15, 5, 4, 1 },		// 00:
	{  80,  56, 0, 0,	15, 6, 0, 2 },		// 01:
	{ 128,  56, 0, 0,	15, 7, 1, 3 },		// 02:
	{ 176,  56, 0, 0,	16, 8, 2, 4 },		// 03:
	{ 224,  56, 0, 0,	16, 9, 3, 0 },		// 04:

	{  32,  96, 0, 0,	0, 10, 9, 6 },		// 05:
	{  80,  96, 0, 0,	1, 11, 5, 7 },		// 06:
	{ 128,  96, 0, 0,	2, 12, 6, 8 },		// 07:
	{ 176,  96, 0, 0,	3, 13, 7, 9 },		// 08:
	{ 224,  96, 0, 0,	4, 14, 8, 5 },		// 09:

	{  32, 136, 0, 0,	5, 15, 14, 11 },		// 10:
	{  80, 136, 0, 0,	6, 15, 10, 12 },		// 11:
	{ 128, 136, 0, 0,	7, 15, 11, 13 },		// 12:
	{ 176, 136, 0, 0,	8, 16, 12, 14 },		// 13:
	{ 224, 136, 0, 0,	9, 16, 13, 10 },		// 14:

	{  40, 176, 0, 0,	10, 0, 16, 16 },		// 15: けってい
	{ 216, 176, 0, 0,	14, 4, 15, 15 },		// 16: やめる
};
static const CURSORMOVE_CALLBACK SearchFormCallBack = {
	CursorMoveCallBack_Dummy,			// on,
	CursorMoveCallBack_Dummy,			// off
	SearchFormCursorMoveCallBack_Move,	// move
	SearchFormCursorMoveCallBack_Toucn,	// touch
};
static const u8 SearchFormCursorAnmTbl[] = {
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,

	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,

	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,
	ZKN2OBJ_M_ANM_CUR_X_4x4,

	ZKN2OBJ_M_ANM_CUR_X_9x2,
	ZKN2OBJ_M_ANM_CUR_X_9x2,
};


static const RECT_HIT_TBL SearchHeightWeitHitTbl[] =
{
	{  60-11,  60+10, 238-8, 238+7 },		// 01: MAX RA
	{  60-11,  60+10,  18-8,  18+7 },		// 00: MAX LA
	{ 132-11, 132+10, 238-8, 238+7 },		// 03: MIN RA
	{ 132-11, 132+10,  18-8,  18+7 },		// 02: MIN LA

	{ RECT_HIT_END, 0, 0, 0 }
};


// タッチ座標テーブル：詳細ページ共通
static const RECT_HIT_TBL DetailPageHitTbl[] =
{
	{ 168, 183,   7,  57 },		//「ぶんぷ」
	{ 168, 183,  71, 121 },		//「おおきさ」
	{ 168, 183, 135, 185 },		//「すがた」
	{ 168, 183, 199, 249 },		//「もどる」
	{ RECT_HIT_END, 0, 0, 0 }
};
// タッチＩＤテーブル：詳細ページ共通
static const u32 DetailPageRetTbl[] = {
	ZKN2UI_DETAIL_ENCOUNT_BTN,	//「ぶんぷ」
	ZKN2UI_DETAIL_SIZE_BTN,		//「おおきさ」
	ZKN2UI_DETAIL_FORM_BTN,		//「すがた」
	ZKN2UI_DETAIL_RET_BTN,		//「もどる」
};

// タッチ座標テーブル：詳細・姿１
static const RECT_HIT_TBL Form1PageHitTbl[] =
{
	{   8,  23, 34, 213 },		// ポケモン名（２個上）
	{  32,  47, 34, 213 },		// ポケモン名（１個上）
	{ 104, 119, 34, 213 },		// ポケモン名（２個下）
	{  80,  95, 34, 213 },		// ポケモン名（１個下）
	{   5,  20, 231, 252 },		// 上矢印
	{ 107, 122, 231, 252 },		// 下矢印
	{  21, 106, 231, 252 },		// レール
	{ 134, 154, 134, 255 },		//「みくらべる」
	{ RECT_HIT_END, 0, 0, 0 }
};
// タッチＩＤテーブル：詳細・姿１
static const u32 Form1PageRetTbl[] = {
	ZKN2UI_FORM1_POKE_U_2,		// ポケモン名（２個上）
	ZKN2UI_FORM1_POKE_U_1,		// ポケモン名（１個上）
	ZKN2UI_FORM1_POKE_D_2,		// ポケモン名（２個下）
	ZKN2UI_FORM1_POKE_D_1,		// ポケモン名（１個下）
	ZKN2UI_FORM1_ARROW_U,		// 上矢印
	ZKN2UI_FORM1_ARROW_D,		// 下矢印
	ZKN2UI_FORM1_RAIL,			// レール
	ZKN2UI_FORM1_MIKURABERU,	//「みくらべる」
};
// タッチ座標テーブル：詳細・姿２
static const RECT_HIT_TBL Form2PageHitTbl[] =
{
	{  48,  63,  56,  71 },		// 左ポケモン上矢印
	{ 120, 136,  56,  71 },		// 左ポケモン下矢印
	{  48,  63, 184, 199 },		// 右ポケモン上矢印
	{ 120, 136, 184, 199 },		// 右ポケモン下矢印
	{ 160, 183,   8, 119 },		// 切り替え
	{ 160, 183, 128, 255 },		// 戻る
	{  67, 116,   2, 114 },		// カーソル左移動
	{  67, 116, 130, 253 },		// カーソル右移動
	{ RECT_HIT_END, 0, 0, 0 }
};
// タッチＩＤテーブル：詳細・姿２
static const u32 Form2PageRetTbl[] = {
	ZKN2UI_FORM2_POKE_LU,		// 左ポケモン上矢印
	ZKN2UI_FORM2_POKE_LD,		// 左ポケモン下矢印
	ZKN2UI_FORM2_POKE_RU,		// 右ポケモン上矢印
	ZKN2UI_FORM2_POKE_RD,		// 右ポケモン下矢印
	ZKN2UI_FORM2_CHANGE,		// 切り替え
	ZKN2UI_FORM2_CANCEL,		// 戻る
	ZKN2UI_FORM2_MOVE_L,		// カーソル左移動
	ZKN2UI_FORM2_MOVE_R,		// カーソル右移動
};

// タッチ座標テーブル：詳細・分布
static const RECT_HIT_TBL EncountPageHitTbl[] =
{
	{  40,  55,  82, 221 },				// 地名（２個上）
	{  64,  79,  82, 221 },				// 地名（１個上）
	{ 136, 151,  82, 221 },				// 地名（２個下）
	{ 112, 127,  82, 221 },				// 地名（１個下）
	{  37,  52, 231, 252 },				// 上矢印
	{ 139, 154, 231, 252 },				// 下矢印
	{  53, 138, 231, 252 },				// レール
	{   6,  25,  70, 129 },				//「ジョウト」
	{   6,  25, 190, 247 },				//「カントー」
	{ TP_USE_CIRCLE, 33,  77, 13 },		// 朝
	{ TP_USE_CIRCLE, 33, 109, 13 },		// 昼
	{ TP_USE_CIRCLE, 33, 141, 13 },		// 夜
	{ RECT_HIT_END, 0, 0, 0 }
};
// タッチＩＤテーブル：詳細・分布
static const u32 EncountPageRetTbl[] = {
	ZKN2UI_ENCOUNT_PLACE_U_2,	// 地名（２個上）
	ZKN2UI_ENCOUNT_PLACE_U_1,	// 地名（１個上）
	ZKN2UI_ENCOUNT_PLACE_D_2,	// 地名（２個下）
	ZKN2UI_ENCOUNT_PLACE_D_1,	// 地名（１個下）
	ZKN2UI_ENCOUNT_ARROW_U,		// 上矢印
	ZKN2UI_ENCOUNT_ARROW_D,		// 下矢印
	ZKN2UI_ENCOUNT_RAIL,		// レール
	ZKN2UI_ENCOUNT_JOHTO,		//「ジョウト」
	ZKN2UI_ENCOUNT_KANTO,		//「カントー」
	ZKN2UI_ENCOUNT_TIME1,		// 朝
	ZKN2UI_ENCOUNT_TIME2,		// 昼
	ZKN2UI_ENCOUNT_TIME3,		// 夜
};

// タッチ座標テーブル：詳細・戻る
static const RECT_HIT_TBL DetailRetPageHitTbl[] =
{
	{ 72, 72+4*8-1, 48, 48+20*8-1 },	// Ａもどる
	{ RECT_HIT_END, 0, 0, 0 }
};



//--------------------------------------------------------------------------------------------
/**
 * トップページのキー／タッチ動作
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_TopMain( ZKN2_WORK * wk )
{
	// タッチ
	wk->ui_flg = 0;

	if( GF_TP_GetTrg() == TRUE ){
		int	ret = GF_TP_RectHitTrg( TopPageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		if( TopPageRetTbl[ret] == ZKN2UI_TOP_SWITCH && wk->zenkoku_mode == FALSE ){
			return ZKN2UI_TOP_COVER;
		}
		return TopPageRetTbl[ret];
	}

	// ここからキー
	wk->ui_flg = 1;

	// 全国図鑑利用可能
	if( wk->zenkoku_mode == TRUE ){
		if( sys.trg & PAD_KEY_LEFT ){
			if( wk->zkn_mode == ZKN2_MODE_JOHTO ){
				return ZKN2UI_TOP_LEFT;
			}
			return ZKN2UI_NONE;	// 動作なし
		}
		if( sys.trg & PAD_KEY_RIGHT ){
			if( wk->zkn_mode == ZKN2_MODE_ZENKOKU ){
				return ZKN2UI_TOP_RIGHT;
			}
			return ZKN2UI_NONE;	// 動作なし
		}
	}

	// Ａボタン or スタートボタン
	if( ( sys.trg & PAD_BUTTON_A ) || ( sys.trg & PAD_BUTTON_START ) ){
		return ZKN2UI_TOP_OPEN;
	}

	// Ｂボタン
	if( sys.trg & PAD_BUTTON_B ){
		return ZKN2UI_TOP_CANCEL;
	}

	// Ｙボタン
	if( sys.trg & PAD_BUTTON_Y ){
		return ZKN2UI_TOP_SUARCH;
	}

	return ZKN2UI_NONE;	// 動作なし
}

//--------------------------------------------------------------------------------------------
/**
 * トップページ：カバーをタッチしているか
 *
 * @param	none
 *
 * @retval	"TRUE = している"
 * @retval	"FALSE = それ以外"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2UI_TopCoverCheck(void)
{
	return GF_TP_SingleHitCont( &TopPageHitTbl[HITTBL_POS_TOP_COVER] );
}

//--------------------------------------------------------------------------------------------
/**
 * リストページのキー／タッチ動作
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_ListMain( ZKN2_WORK * wk, BOOL space )
{
	u32	tpx, tpy;

	// タッチ
	wk->ui_flg = 0;

	if( GF_TP_GetPointTrg( &tpx, &tpy ) == TRUE ){
		int	ret = GF_TP_RectHitTrg( ListPageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		// リスト選択
		if( ListPageRetTbl[ret] == ZKN2UI_LIST_MOVE ){
			u8	pos;
			tpx -= LIST_AREA_LX;
			tpy -= LIST_AREA_LY;
			pos = tpy / LIST_BLOCK_SY * ZKN2_POKEICON_PUT_H_MAX + tpx / LIST_BLOCK_SX;
			if( pos == wk->list_pos ){
				return ZKN2UI_LIST_INFO;
			}
			wk->list_pos = pos;
			Snd_SePlay( SE_ZKN2_BUTTON );
		}else if( ListPageRetTbl[ret] == ZKN2UI_LIST_COVER ){
			Snd_SePlay( SE_ZKN2_CLOSE );
		}else if( ListPageRetTbl[ret] == ZKN2UI_LIST_SUARCH ){
			Snd_SePlay( SE_ZKN2_DECIDE );
		}else if(  ListPageRetTbl[ret] == ZKN2UI_LIST_CANCEL ){
			Snd_SePlay( SE_ZKN2_CANCEL );
		}
		return ListPageRetTbl[ret];
	}

	// ここからキー
	wk->ui_flg = 1;

	// 上
	if( sys.repeat & PAD_KEY_UP ){
		if( wk->list_pos >= 0 && wk->list_pos < ZKN2_POKEICON_PUT_H_MAX ){
			return ZKN2UI_LIST_ARROW_U_KEY;
		}else{
			wk->list_pos -= ZKN2_POKEICON_PUT_H_MAX;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// 下
	if( sys.repeat & PAD_KEY_DOWN ){
		if( wk->list_pos >= ( ZKN2_POKEICON_SEL_MAX - ZKN2_POKEICON_PUT_H_MAX ) &&
			wk->list_pos < ZKN2_POKEICON_SEL_MAX ){
			return ZKN2UI_LIST_ARROW_D_KEY;
		}else{
			wk->list_pos += ZKN2_POKEICON_PUT_H_MAX;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// 左
	if( sys.repeat & PAD_KEY_LEFT ){
		if( wk->list_pos != 0 ){
			wk->list_pos--;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}else{
			if( wk->list_scr != 0 ){
				wk->list_pos = ZKN2_POKEICON_SEL_MAX - 1;
				return ZKN2UI_LIST_ARROW_U;
			}
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// 右
	if( sys.repeat & PAD_KEY_RIGHT ){
		if( ( wk->list_pos + 1 ) != ZKN2_POKEICON_SEL_MAX ){
			wk->list_pos++;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}else{
			if( ( wk->list_scr + 1 ) <= ZKN2LIST_ListScrollMaxGet(wk,space) ){
				wk->list_pos = 0;
				return ZKN2UI_LIST_ARROW_D;
			}
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// Ａボタン
	if( sys.trg & PAD_BUTTON_A ){
		return ZKN2UI_LIST_INFO;
	}

	// Ｂボタン
	if( sys.trg & PAD_BUTTON_B ){
		Snd_SePlay( SE_ZKN2_CANCEL );
		return ZKN2UI_LIST_CANCEL_BUTTON;
	}

	// Ｘボタン
	if( sys.trg & PAD_BUTTON_X ){
		return ZKN2UI_LIST_VOICE;
	}

	// Ｙボタン
	if( sys.trg & PAD_BUTTON_Y ){
		Snd_SePlay( SE_ZKN2_DECIDE );
		return ZKN2UI_LIST_SUARCH;
	}

	// Ｌボタン
	if( sys.repeat & PAD_BUTTON_L ){
		return ZKN2UI_LIST_ARROW_U;
	}

	// Ｒボタン
	if( sys.repeat & PAD_BUTTON_R ){
		return ZKN2UI_LIST_ARROW_D;
	}

	// セレクトボタン
	if( sys.trg & PAD_BUTTON_SELECT ){
		return ZKN2UI_LIST_ARROW_R;
	}

	// スタートボタン
	if( sys.trg & PAD_BUTTON_START ){
		Snd_SePlay( SE_ZKN2_CLOSE );
		return ZKN2UI_LIST_CLOSE;
	}

	return ZKN2UI_NONE;	// 動作なし
}

//--------------------------------------------------------------------------------------------
/**
 * リストページ：カバーハンドルをタッチしているか
 *
 * @param	none
 *
 * @retval	"TRUE = している"
 * @retval	"FALSE = それ以外"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2UI_ListCoverCheck(void)
{
	return GF_TP_SingleHitCont( &ListPageHitTbl[HITTBL_POS_LIST_COVER] );
}


//--------------------------------------------------------------------------------------------
/**
 * 検索画面メインページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		初期位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchMainCursorMoveSet( ZKN2_WORK * wk, u32 pos )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchMainHitTbl,
				SearchMainKeyTbl,
				&SearchMainCallBack,
				wk,
				TRUE,
				pos,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchCursorObjMove( wk, pos );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面メインページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchMain( ZKN2_WORK * wk )
{
	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_START;
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面メインページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );

	PointerWkPosGet( pw, &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, SearchCursorAnmTbl[pos] );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面メインページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchMainCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchCursorObjMove( wk, now_pos );

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面メインページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchMainCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面並び順選択ページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchRowCursorMoveSet( ZKN2_WORK * wk )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchRowHitTbl,
				SearchRowKeyTbl,
				&SearchRowCallBack,
				wk,
				TRUE,
				0,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchRowCursorObjMove( wk, 0 );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面並び順選択ページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchRowMain( ZKN2_WORK * wk )
{
	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_ROW_ENTER;
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面並び順選択ページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchRowCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );

	PointerWkPosGet( pw, &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, SearchRowCursorAnmTbl[pos] );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面並び順選択ページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchRowCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchRowCursorObjMove( wk, now_pos );

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面並び順選択ページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchRowCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchRowCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面名前選択ページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchNameCursorMoveSet( ZKN2_WORK * wk )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchNameHitTbl,
				SearchNameKeyTbl,
				&SearchNameCallBack,
				wk,
				TRUE,
				0,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchNameCursorObjMove( wk, 0 );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面名前選択ページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchNameMain( ZKN2_WORK * wk )
{
	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_NAME_ENTER;
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面名前選択ページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchNameCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );

	PointerWkPosGet( pw, &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	if( pos >= ZKN2UI_SEARCH_NAME_ENTER ){
		ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, ZKN2OBJ_M_ANM_CUR_X_9x2 );
	}else{
		ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, ZKN2OBJ_M_ANM_CUR_X_2x2 );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面名前選択ページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchNameCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	// けってい
	if( old_pos == ZKN2UI_SEARCH_NAME_ENTER ){
		// 下
		if( now_pos == 0 ){
			if( wk->search_pos ==  4 || wk->search_pos ==  9 ||
				wk->search_pos == 14 || wk->search_pos == 19 || wk->search_pos == 24 ){
				now_pos = wk->search_pos - 4;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_ENTER );
			}else if( wk->search_pos ==  0 || wk->search_pos ==  5 ||
					  wk->search_pos == 10 || wk->search_pos == 15 || wk->search_pos == 20 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_ENTER );
			}
		// 上
		}else if( now_pos == 4 ){
			if( wk->search_pos ==  0 || wk->search_pos ==  5 ||
				wk->search_pos == 10 || wk->search_pos == 15 || wk->search_pos == 20 ){
				now_pos = wk->search_pos + 4;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_ENTER );
			}else if( wk->search_pos ==  4 || wk->search_pos ==  9 ||
					  wk->search_pos == 14 || wk->search_pos == 19 || wk->search_pos == 24 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_ENTER );
			}
		}
	// やめる
	}else if( old_pos == ZKN2UI_SEARCH_NAME_CANCEL ){
		if( now_pos == 43 ){
			if( wk->search_pos == 29 ){
				now_pos = 25;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 34 ){
				now_pos = 30;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 37 ){
				now_pos = 35;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 42 ){
				now_pos = 38;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 44 ){
				now_pos = 43;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 25 || wk->search_pos == 30 ||
					  wk->search_pos == 35 || wk->search_pos == 38 || wk->search_pos == 43 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}
		}else if( now_pos == 44 ){
			if( wk->search_pos == 25 ){
				now_pos = 29;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 30 ){
				now_pos = 34;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 35 ){
				now_pos = 37;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 38 ){
				now_pos = 42;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 43 ){
				now_pos = 44;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}else if( wk->search_pos == 29 || wk->search_pos == 34 ||
					  wk->search_pos == 37 || wk->search_pos == 42 || wk->search_pos == 44 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_NAME_CANCEL );
			}
		}
	}

	SearchNameCursorObjMove( wk, now_pos );

	wk->search_pos = old_pos;

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面名前選択ページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchNameCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchNameCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );

	wk->search_pos = old_pos;
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面タイプ選択ページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchTypeCursorMoveSet( ZKN2_WORK * wk )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchTypeHitTbl,
				SearchTypeKeyTbl,
				&SearchTypeCallBack,
				wk,
				TRUE,
				0,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchTypeCursorObjMove( wk, 0 );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面タイプ選択ページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchTypeMain( ZKN2_WORK * wk )
{
	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_TYPE_ENTER;
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面タイプ選択ページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchTypeCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );

	PointerWkPosGet( pw, &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, SearchTypeCursorAnmTbl[pos] );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面タイプ選択ページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchTypeCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	// けってい
	if( old_pos == ZKN2UI_SEARCH_TYPE_ENTER ){
		// 下
		if( now_pos == 0 ){
			if( wk->search_pos >= 16 && wk->search_pos <= 17 ){
				now_pos = wk->search_pos % 4;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_ENTER );
			}else if( wk->search_pos >= 0 && wk->search_pos <= 1 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_ENTER );
			}
		// 上
		}else if( now_pos == 16 ){
			if( wk->search_pos >= 0 && wk->search_pos <= 1 ){
				now_pos = wk->search_pos + 16;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_ENTER );
			}else if( wk->search_pos >= 16 && wk->search_pos <= 17 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_ENTER );
			}
		}
	// やめる
	}else if( old_pos == ZKN2UI_SEARCH_TYPE_CANCEL ){
		if( now_pos == 3 ){
			if( wk->search_pos >= 14 && wk->search_pos <= 15 ){
				now_pos = wk->search_pos % 4;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_CANCEL );
			}else if( wk->search_pos >= 2 && wk->search_pos <= 3 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_CANCEL );
			}
		}else if( now_pos == 15 ){
			if( wk->search_pos >= 2 && wk->search_pos <= 3 ){
				now_pos = wk->search_pos + 12;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_CANCEL );
			}else if( wk->search_pos >= 14 && wk->search_pos <= 15 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_TYPE_CANCEL );
			}
		}
	}

	SearchTypeCursorObjMove( wk, now_pos );

	wk->search_pos = old_pos;

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面タイプ選択ページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchTypeCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchTypeCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );

	wk->search_pos = old_pos;
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面高さ選択ページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchHeightCursorMoveSet( ZKN2_WORK * wk )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchHeightHitTbl,
				SearchHeightKeyTbl,
				&SearchHeightCallBack,
				wk,
				TRUE,
				0,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchHeightCursorObjMove( wk, 0 );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面高さ選択ページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchHeightMain( ZKN2_WORK * wk )
{
	u32	pos = CURSORMOVE_PosGet( wk->cmwk );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_HEIGHT_ENTER;
	}

	if( pos == ZKN2UI_SEARCH_HEIGHT_MAX_CUR ){
		if( sys.repeat & PAD_KEY_LEFT ){
			return ZKN2UI_SEARCH_HEIGHT_M_MAX;
		}
		if( sys.repeat & PAD_KEY_RIGHT ){
			return ZKN2UI_SEARCH_HEIGHT_P_MAX;
		}
	}
	if( pos == ZKN2UI_SEARCH_HEIGHT_MIN_CUR ){
		if( sys.repeat & PAD_KEY_LEFT ){
			return ZKN2UI_SEARCH_HEIGHT_M_MIN;
		}
		if( sys.repeat & PAD_KEY_RIGHT ){
			return ZKN2UI_SEARCH_HEIGHT_P_MIN;
		}
	}

	{
		u32	ret = GF_TP_RectHitCont( SearchHeightWeitHitTbl );

		if( ret != RECT_HIT_NONE ){
			KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );
			CURSORMOVE_PosSet( wk->cmwk, ret / 2 );
			SearchHeightCursorObjMove( wk, ret / 2 );
			return ( ZKN2UI_SEARCH_HEIGHT_P_MAX + ret );
		}
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面高さ選択ページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchHeightCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
//	s16	obj_x, obj_y;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );
	PointerWkPosGet( pw, &x, &y );

	if( pos == ZKN2UI_SEARCH_HEIGHT_MAX_CUR ){
		x = ZKN2OBJ_SearchMaxMinPosGet( wk, wk->search_prm[ZKN2_SEARCH_PRM_HEIGHT_H] );
	}else if( pos == ZKN2UI_SEARCH_HEIGHT_MIN_CUR ){
		x = ZKN2OBJ_SearchMaxMinPosGet( wk, wk->search_prm[ZKN2_SEARCH_PRM_HEIGHT_L] );
	}
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, SearchHeightCursorAnmTbl[pos] );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面高さ選択ページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchHeightCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchHeightCursorObjMove( wk, now_pos );

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面高さ選択ページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchHeightCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchHeightCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面重さ選択ページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchWeightCursorMoveSet( ZKN2_WORK * wk )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchWeightHitTbl,
				SearchWeightKeyTbl,
				&SearchWeightCallBack,
				wk,
				TRUE,
				0,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchWeightCursorObjMove( wk, 0 );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面重さ選択ページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchWeightMain( ZKN2_WORK * wk )
{
	u32	pos = CURSORMOVE_PosGet( wk->cmwk );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_WEIGHT_ENTER;
	}

	if( pos == ZKN2UI_SEARCH_WEIGHT_MAX_CUR ){
		if( sys.repeat & PAD_KEY_LEFT ){
			return ZKN2UI_SEARCH_WEIGHT_M_MAX;
		}
		if( sys.repeat & PAD_KEY_RIGHT ){
			return ZKN2UI_SEARCH_WEIGHT_P_MAX;
		}
	}
	if( pos == ZKN2UI_SEARCH_WEIGHT_MIN_CUR ){
		if( sys.repeat & PAD_KEY_LEFT ){
			return ZKN2UI_SEARCH_WEIGHT_M_MIN;
		}
		if( sys.repeat & PAD_KEY_RIGHT ){
			return ZKN2UI_SEARCH_WEIGHT_P_MIN;
		}
	}

	{
		u32	ret = GF_TP_RectHitCont( SearchHeightWeitHitTbl );

		if( ret != RECT_HIT_NONE ){
			KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );
			CURSORMOVE_PosSet( wk->cmwk, ret / 2 );
			SearchWeightCursorObjMove( wk, ret / 2 );
			return ( ZKN2UI_SEARCH_WEIGHT_P_MAX + ret );
		}
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面重さ選択ページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchWeightCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );
	PointerWkPosGet( pw, &x, &y );

	if( pos == ZKN2UI_SEARCH_WEIGHT_MAX_CUR ){
		x = ZKN2OBJ_SearchMaxMinPosGet( wk, wk->search_prm[ZKN2_SEARCH_PRM_WEIGHT_H] );
	}else if( pos == ZKN2UI_SEARCH_WEIGHT_MIN_CUR ){
		x = ZKN2OBJ_SearchMaxMinPosGet( wk, wk->search_prm[ZKN2_SEARCH_PRM_WEIGHT_L] );
	}
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, SearchWeightCursorAnmTbl[pos] );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面重さ選択ページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchWeightCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchWeightCursorObjMove( wk, now_pos );

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面重さ選択ページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchWeightCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchWeightCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );
}

//--------------------------------------------------------------------------------------------
/**
 * タッチしているかをチェックしてＸ座標を取得
 *
 * @param	x	Ｘ座標格納場所
 *
 * @retval	"TRUE = タッチしている"
 * @retval	"FALSE = それ以外"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2UI_HeightWeightAreaCheck( u32 * x )
{
	u32	y;
	return GF_TP_GetPointCont( x, &y );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面地域選択ページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchAreaCursorMoveSet( ZKN2_WORK * wk )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchAreaHitTbl,
				SearchAreaKeyTbl,
				&SearchAreaCallBack,
				wk,
				TRUE,
				0,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchAreaCursorObjMove( wk, 0 );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面地域選択ページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchAreaMain( ZKN2_WORK * wk )
{
	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_AREA_ENTER;
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面地域選択ページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchAreaCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );

	PointerWkPosGet( pw, &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, SearchAreaCursorAnmTbl[pos] );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面地域選択ページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchAreaCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchAreaCursorObjMove( wk, now_pos );

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面地域選択ページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchAreaCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchAreaCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面形選択ページ：CURSOR_MOVE設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_SearchFormCursorMoveSet( ZKN2_WORK * wk )
{
	wk->cmwk = CURSORMOVE_Create(
				SearchFormHitTbl,
				SearchFormKeyTbl,
				&SearchFormCallBack,
				wk,
				TRUE,
				0,
				HEAPID_ZUKAN );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_CURSOR, TRUE );
	SearchFormCursorObjMove( wk, 0 );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面形選択ページ：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchFormMain( ZKN2_WORK * wk )
{
	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_KEY );

	if( sys.trg & PAD_BUTTON_START ){
		return ZKN2UI_SEARCH_FORM_ENTER;
	}

	return CURSORMOVE_MainCont( wk->cmwk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面形選択ページ：カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchFormCursorObjMove( ZKN2_WORK * wk, int pos )
{
	const POINTER_WORK * pw;
	u8	x, y;

	pw = CURSORMOVE_PointerWorkGet( wk->cmwk, pos );

	PointerWkPosGet( pw, &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x, y );
	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_CURSOR, SearchFormCursorAnmTbl[pos] );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面形選択ページ：カーソル移動時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchFormCursorMoveCallBack_Move( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	// けってい
	if( old_pos == ZKN2UI_SEARCH_FORM_ENTER ){
		// 下
		if( now_pos == 0 ){
			if( wk->search_pos >= 0 && wk->search_pos <= 2 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_ENTER );
			}else if( wk->search_pos >= 10 && wk->search_pos <= 12 ){
				now_pos = wk->search_pos % 5;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_ENTER );
			}
		// 上
		}else if( now_pos == 10 ){
			if( wk->search_pos >= 0 && wk->search_pos <= 2 ){
				now_pos = wk->search_pos + 10;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_ENTER );
			}else if( wk->search_pos >= 10 && wk->search_pos <= 12 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_ENTER );
			}
		}
	// やめる
	}else if( old_pos == ZKN2UI_SEARCH_FORM_CANCEL ){
		if( now_pos == 4 ){
			if( wk->search_pos >= 3 && wk->search_pos <= 4 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_CANCEL );
			}else if( wk->search_pos >= 13 && wk->search_pos <= 14 ){
				now_pos = wk->search_pos % 5;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_CANCEL );
			}
		}else if( now_pos == 14 ){
			if( wk->search_pos >= 3 && wk->search_pos <= 4 ){
				now_pos = wk->search_pos + 10;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_CANCEL );
			}else if( wk->search_pos >= 13 && wk->search_pos <= 14 ){
				now_pos = wk->search_pos;
				CURSORMOVE_PosSetEx( wk->cmwk, now_pos, old_pos, ZKN2UI_SEARCH_FORM_CANCEL );
			}
		}
	}

	SearchFormCursorObjMove( wk, now_pos );

	wk->search_pos = old_pos;

	Snd_SePlay( SE_ZKN2_SELECT );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面形選択ページ：タッチ時のコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchFormCursorMoveCallBack_Toucn( void * work, int now_pos, int old_pos )
{
	ZKN2_WORK * wk = work;

	SearchFormCursorObjMove( wk, now_pos );

	KeyTouchStatus_SetTouchOrKey( wk->dat->kt_status, APP_END_TOUCH );

	wk->search_pos = old_pos;
}

//--------------------------------------------------------------------------------------------
/**
 * 検索結果リスト：キータッチメイン
 *
 * @param	wk		図鑑画面ワーク
 * @param	space	リストにスペースがあるか（検索結果リストは常になし）
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_SearchListMain( ZKN2_WORK * wk, BOOL space )
{
	u32	tpx, tpy;

	if( GF_TP_GetPointTrg( &tpx, &tpy ) == TRUE ){
		int	ret = GF_TP_RectHitTrg( ListPageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		// リスト選択
		if( ListPageRetTbl[ret] == ZKN2UI_LIST_MOVE ){
			u8	pos;
			tpx -= LIST_AREA_LX;
			tpy -= LIST_AREA_LY;
			pos = tpy / LIST_BLOCK_SY * ZKN2_POKEICON_PUT_H_MAX + tpx / LIST_BLOCK_SX;
			if( pos == wk->list_pos ){
				if( wk->list_pos == 0 && wk->list_scr == 0 ){
					Snd_SePlay(  SE_ZKN2_DECIDE );
					return ZKN2UI_LIST_SUARCH;
				}else{
					return ZKN2UI_LIST_INFO;
				}
			}
			wk->list_pos =pos;
#ifdef	GS_AFTERMASTER_GF1061_20091009_FIX
			Snd_SePlay( SE_ZKN2_BUTTON );
#else
			Snd_SePlay( SE_ZKN2_SELECT );
#endif
		}else if( ListPageRetTbl[ret] == ZKN2UI_LIST_SUARCH ){
			Snd_SePlay(  SE_ZKN2_DECIDE );
		}else if( ListPageRetTbl[ret] == ZKN2UI_LIST_CANCEL ){
			Snd_SePlay(  SE_ZKN2_CANCEL );
		}
		return ListPageRetTbl[ret];
	}

	// 上
	if( sys.repeat & PAD_KEY_UP ){
		if( wk->list_pos >= 0 && wk->list_pos < ZKN2_POKEICON_PUT_H_MAX ){
			return ZKN2UI_LIST_ARROW_U_KEY;
		}else{
			wk->list_pos -= ZKN2_POKEICON_PUT_H_MAX;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// 下
	if( sys.repeat & PAD_KEY_DOWN ){
		if( wk->list_pos >= ( ZKN2_POKEICON_SEL_MAX - ZKN2_POKEICON_PUT_H_MAX ) &&
			wk->list_pos < ZKN2_POKEICON_SEL_MAX ){
			return ZKN2UI_LIST_ARROW_D_KEY;
		}else{
			wk->list_pos += ZKN2_POKEICON_PUT_H_MAX;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// 左
	if( sys.repeat & PAD_KEY_LEFT ){
		if( wk->list_pos != 0 ){
			wk->list_pos--;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}else{
			if( wk->list_scr != 0 ){
				wk->list_pos = ZKN2_POKEICON_SEL_MAX - 1;
				return ZKN2UI_LIST_ARROW_U;
			}
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// 右
	if( sys.repeat & PAD_KEY_RIGHT ){
		if( ( wk->list_pos + 1 ) != ZKN2_POKEICON_SEL_MAX ){
			wk->list_pos++;
			Snd_SePlay( SE_ZKN2_SELECT );
			return ZKN2UI_LIST_MOVE;
		}else{
			if( ( wk->list_scr + 1 ) <= ZKN2LIST_ListScrollMaxGet(wk,space) ){
				wk->list_pos = 0;
				return ZKN2UI_LIST_ARROW_D;
			}
		}
		return ZKN2UI_NONE;	// 動作なし
	}

	// Ａボタン
	if( sys.trg & PAD_BUTTON_A ){
		return ZKN2UI_LIST_INFO;
	}

	// Ｂボタン
	if( sys.trg & PAD_BUTTON_B ){
		Snd_SePlay( SE_ZKN2_CANCEL );
		return ZKN2UI_LIST_CANCEL_BUTTON;
	}

	// Ｘボタン
	if( sys.trg & PAD_BUTTON_X ){
		return ZKN2UI_LIST_VOICE;
	}

	// Ｙボタン
	if( sys.trg & PAD_BUTTON_Y ){
		Snd_SePlay( SE_ZKN2_DECIDE );
		return ZKN2UI_LIST_SUARCH;
	}

	// Ｌボタン
	if( sys.repeat & PAD_BUTTON_L ){
		return ZKN2UI_LIST_ARROW_U;
	}

	// Ｒボタン
	if( sys.repeat & PAD_BUTTON_R ){
		return ZKN2UI_LIST_ARROW_D;
	}

	// セレクトボタン
	if( sys.trg & PAD_BUTTON_SELECT ){
		return ZKN2UI_LIST_ARROW_R;
	}

	return ZKN2UI_NONE;	// 動作なし
}


//--------------------------------------------------------------------------------------------
/**
 * カーソル移動ワーク削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2UI_CursorMoveWorkExit( ZKN2_WORK * wk )
{
	if( wk->cmwk != NULL ){
		CURSORMOVE_Exit( wk->cmwk );
		wk->cmwk = NULL;
	}
}

//--------------------------------------------------------------------------------------------
/**
 * カーソル移動ダミーコールバック関数
 *
 * @param	wk			図鑑画面ワーク
 * @param	now_pos		現在位置
 * @param	old_pos		前回位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void CursorMoveCallBack_Dummy( void * work, int now_pos, int old_pos )
{
}


//--------------------------------------------------------------------------------------------
/**
 * 詳細画面共通キータッチ処理
 *
 * @param	wk		図鑑画面ワーク
 * @param	touch	タッチされたかを格納 ( TRUE = touch )
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
static u32 DetailMain( ZKN2_WORK * wk, BOOL * touch )
{
	if( GF_TP_GetTrg() == TRUE ){
		int	ret = GF_TP_RectHitTrg( DetailPageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		{
			u32	x, y;
			GF_TP_GetPointTrg( &x, &y );
			OS_Printf( "x = %d, y = %d\n", x, y );
		}
		if( DetailPageRetTbl[ret] == ZKN2UI_DETAIL_SIZE_BTN &&
			!( ZukanWork_GetPokeGetFlag(wk->dat->zukan_work,wk->detail_mons) ) ){
			return ZKN2UI_NONE;		// 動作なし
		}
		*touch = TRUE;
		return DetailPageRetTbl[ret];
	}

	if( sys.trg & PAD_BUTTON_B ){
		*touch = FALSE;
		return ZKN2UI_DETAIL_RET_BTN;
	}

	return ZKN2UI_NONE;		// 動作なし
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ キータッチ処理
 *
 * @param	wk		図鑑画面ワーク
 * @param	touch	タッチされたかを格納 ( TRUE = touch )
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_DetailEncountMain( ZKN2_WORK * wk, BOOL * touch )
{
	u32	ret = DetailMain( wk, touch );

	if( ret != ZKN2UI_NONE ){
		return ret;
	}

	if( GF_TP_GetTrg() == TRUE ){
		ret = GF_TP_HitTrg( EncountPageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		*touch = TRUE;
		return EncountPageRetTbl[ret];
	}

	*touch = FALSE;

	if( sys.repeat & PAD_KEY_UP ){
		return ZKN2UI_ENCOUNT_PLACE_U_1;
	}

	if( sys.repeat & PAD_KEY_DOWN ){
		return ZKN2UI_ENCOUNT_PLACE_D_1;
	}

	if( sys.trg & PAD_BUTTON_A ){
		if( wk->detail_place_time == 0 ){
			return ZKN2UI_ENCOUNT_TIME2;
		}else if( wk->detail_place_time == 1 ){
			return ZKN2UI_ENCOUNT_TIME3;
		}
		return ZKN2UI_ENCOUNT_TIME1;
	}

	if( sys.trg & PAD_BUTTON_SELECT ){
		if( wk->detail_place_mode == 0 ){
			return ZKN2UI_ENCOUNT_KANTO;
		}else{
			return ZKN2UI_ENCOUNT_JOHTO;
		}
		return ZKN2UI_NONE;		// 動作なし
	}

	if( wk->detail_place_mode == 0 ){
		if( sys.trg & PAD_BUTTON_R ){
			return ZKN2UI_ENCOUNT_KANTO;
		}
	}else{
		if( sys.trg & PAD_BUTTON_L ){
			return ZKN2UI_ENCOUNT_JOHTO;
		}
	}

	if( sys.repeat & PAD_KEY_LEFT ){
		return ZKN2UI_ENCOUNT_RETSET;
	}

	if( sys.repeat & PAD_KEY_RIGHT ){
		if( ZukanWork_GetPokeGetFlag( wk->dat->zukan_work, wk->detail_mons ) ){
			return ZKN2UI_DETAIL_SIZE_BTN;
		}else{
			return ZKN2UI_DETAIL_FORM_BTN;
		}
		return ZKN2UI_NONE;		// 動作なし
	}

	return ZKN2UI_NONE;		// 動作なし
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ キータッチ処理
 *
 * @param	wk		図鑑画面ワーク
 * @param	touch	タッチされたかを格納 ( TRUE = touch )
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_DetailSizeMain( ZKN2_WORK * wk, BOOL * touch )
{
	u32	ret;

	ret = DetailMain( wk, touch );

	if( ret != ZKN2UI_NONE ){
		return ret;
	}

	*touch = FALSE;

	if( sys.repeat & PAD_KEY_LEFT ){
		return ZKN2UI_DETAIL_ENCOUNT_BTN;
	}

	if( sys.repeat & PAD_KEY_RIGHT ){
		return ZKN2UI_DETAIL_FORM_BTN;
	}

	return ZKN2UI_NONE;		// 動作なし
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ１ キータッチ処理
 *
 * @param	wk		図鑑画面ワーク
 * @param	touch	タッチされたかを格納 ( TRUE = touch )
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_DetailForm1Main( ZKN2_WORK * wk, BOOL * touch )
{
	u32	ret = DetailMain( wk, touch );

	if( ret != ZKN2UI_NONE ){
		return ret;
	}

	if( GF_TP_GetTrg() == TRUE ){
		ret = GF_TP_RectHitTrg( Form1PageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		*touch = TRUE;
		return Form1PageRetTbl[ret];
	}

	*touch = FALSE;

	if( sys.repeat & PAD_KEY_UP ){
		return ZKN2UI_FORM1_POKE_U_1;
	}

	if( sys.repeat & PAD_KEY_DOWN ){
		return ZKN2UI_FORM1_POKE_D_1;
	}

	if( sys.repeat & PAD_KEY_LEFT ){
		if( ZukanWork_GetPokeGetFlag( wk->dat->zukan_work, wk->detail_mons ) ){
			return ZKN2UI_DETAIL_SIZE_BTN;
		}else{
			return ZKN2UI_DETAIL_ENCOUNT_BTN;
		}
	}

	if( sys.repeat & PAD_KEY_RIGHT ){
		return ZKN2UI_FORM1_RETSET;
	}

	if( sys.trg & PAD_BUTTON_A ){
		return ZKN2UI_FORM1_MIKURABERU;
	}

	return ZKN2UI_NONE;		// 動作なし
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ２ キータッチ処理
 *
 * @param	wk		図鑑画面ワーク
 * @param	touch	タッチされたかを格納 ( TRUE = touch )
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_DetailForm2Main( ZKN2_WORK * wk, BOOL * touch )
{
	if( GF_TP_GetTrg() == TRUE ){
		int ret = GF_TP_RectHitTrg( Form2PageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		*touch = TRUE;
		return Form2PageRetTbl[ret];
	}

	*touch = FALSE;

	if( sys.repeat & PAD_KEY_UP ){
		if( wk->detail_form2_cursor == 0 ){
			return ZKN2UI_FORM2_POKE_LU;
		}else{
			return ZKN2UI_FORM2_POKE_RU;
		}
	}

	if( sys.repeat & PAD_KEY_DOWN ){
		if( wk->detail_form2_cursor == 0 ){
			return ZKN2UI_FORM2_POKE_LD;
		}else{
			return ZKN2UI_FORM2_POKE_RD;
		}
	}

	if( sys.trg & PAD_KEY_LEFT ){
		return ZKN2UI_FORM2_MOVE_L;
	}

	if( sys.trg & PAD_KEY_RIGHT ){
		return ZKN2UI_FORM2_MOVE_R;
	}

	if( sys.trg & PAD_BUTTON_X ){
		return ZKN2UI_FORM2_CHANGE;
	}

	if( sys.trg & ( PAD_BUTTON_B | PAD_BUTTON_A ) ){
		return ZKN2UI_FORM2_CANCEL;
	}

	return ZKN2UI_NONE;		// 動作なし
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面戻るページ キータッチ処理
 *
 * @param	wk		図鑑画面ワーク
 * @param	touch	タッチされたかを格納 ( TRUE = touch )
 *
 * @return	動作結果
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2UI_DetailRetMain( ZKN2_WORK * wk, BOOL * touch )
{
	u32	ret = DetailMain( wk, touch );

	if( ret != ZKN2UI_NONE ){
		return ret;
	}

	if( GF_TP_GetTrg() == TRUE ){
		ret = GF_TP_HitTrg( DetailRetPageHitTbl );
		if( ret == RECT_HIT_NONE ){
			return ZKN2UI_NONE;	// 動作なし
		}
		*touch = TRUE;
		return ZKN2UI_DETAILRET_A;
	}

	*touch = FALSE;

	if( sys.repeat & PAD_KEY_LEFT ){
		return ZKN2UI_DETAIL_FORM_BTN;
	}

	if( sys.repeat & PAD_KEY_RIGHT ){
		return ZKN2UI_DETAIL_ENCOUNT_BTN;
	}

	if( sys.trg & PAD_BUTTON_A ){
		return ZKN2UI_DETAIL_RET_BTN;
	}

	return ZKN2UI_NONE;		// 動作なし
}